#include <stdio.h>

int arr[9], book[9];

void dfs(int step);

int main()
{
	dfs(0);
	return 0;
}

void dfs(int step)
{
	if (step == 9)
	{
		if ((arr[0] * 100 + arr[1] * 10 + arr[2]) + (arr[3] * 100 + arr[4] * 10 + arr[5]) == arr[6] * 100 + arr[7] * 10 + arr[8])
		{
			printf("%d%d%d + %d%d%d = %d%d%d\n", arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[8]);
		}
	}
	for (int i = 1; i <= 9; i++)
	{
		if (book[i] == 1)
			continue;
		arr[step] = i;
		book[i] = 1;
		dfs(step + 1);
		book[i] = 0;
	}
	return;
}